import { http } from "@/utils/http";
import { baseUrlApi, filerEmptyVal } from "../utils";

/** 商品调账记录列表 */
export const getTransferPage = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/transfer/page"), {
    params: filerEmptyVal(params)
  });
};

/** 添加商品调账记录 */
export const transferAdd = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/transfer/add"), { data });
};

/** 新增内查询 */
export const getTransferSearch = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/transfer/add/search"), {
    params: filerEmptyVal(params)
  });
};

/** 删除商品调账记录 */
export const transferDel = data => {
  return http.request<any>(
    "post",
    baseUrlApi("/transfer/delete?id=" + data.id),
    {
      data
    }
  );
};
